<!DOCTYPE html>
<html>
<head>
  <title>ROBIN HOOD CUP</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <style type="text/css">
    *{
      margin:0;
      padding:0;
    }
    
    h4{
      text-align: center;
      margin:20px 0;
    }

    #imgdiv{
      width: 100%;
      margin:50px auto;
    }

    #imgdiv img{
      width: 100vw;
      margin:20px 0px;
    }

    #bigimg{
      width: 100%;
      height: 100%;
      position: fixed;
      background: #000;
      top: 0;
      display: none;
    }

    #bigimg img{
      width: 100%;
      margin:auto;
      position: fixed;
      left:0;
      right:0;
      top: 0;
	  bottom: 0;
      cursor: pointer;
    }
  </style>
</head>
<body>
  <h4>点击图片可放大/缩小</h4>
  <!-- 图片容器 -->
  <div id="imgdiv">
    <img src="img/map/0.png" id="img0" onclick="imgbig(0)"/>
	<img src="img/map/1.png" id="img1"  onclick="imgbig(1)"/>
	<img src="img/map/2.png" id="img2"  onclick="imgbig(2)"/>
	<img src="img/map/3.png" id="img3"  onclick="imgbig(3)"/>
  </div>

  <!-- 放大遮罩层 -->
  <div id="bigimg" onclick="closeimg();"></div>
</body>

<!-- JS -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.1.1/jquery.js"></script>
<script>
function imgbig(idx) {
  var imgsrc = $('#img' + idx).attr('src');
  $("#bigimg").css("display","block");
  $("#bigimg").html("<img src=" + imgsrc + " />");
}

function closeimg() {
  $("#bigimg").css("display","none");
}
</script>
</html>
